package mymvc.observer
{
	import flash.sampler.NewObjectSample;

	public class ObserverData
	{
		public var args:Array = null;
		public function ObserverData()
		{
			args = new Array();
		}
		
		public function setData(dataKey:String,value:Object):ObserverData{
			var obj:Object = new Object();
			obj["key"] = dataKey;
			obj["value"] = value;
			args.push(obj);
			return this;
		}
		
		public function getData(dataKey:String):Object{
			var value:Object = null;
			
			for(var i:int = 0;i<args.length;i++){
				if(args[i].key == dataKey){
					value = args[i].value;
					break;
				}
			}
		/*	args.forEach(function(obj:Object){
				if(obj.key == dataKey){
					value = obj.value;	
				}
			},null);
			 */
			return value;
		}
		
	}
}